package com.example.jw_web.Mapper;

import com.example.jw_web.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

@Mapper
@Component //将当前对象交给IOC容器管理
public interface RegisterDao {

     //查询用户填的名字是否存在 - ->返回查询出来得数据组数
    @Select("select count(*) username  from  user where username=#{username} and email=#{email}")
    public int  selectUser(String username ,String email);


    //添加用户
    @Insert("insert into user(username, password, email) VALUE (#{username},#{password},#{email})")
    public void insert(User user);

}
